(bug 3678) Allow disabling [[MediaWiki:aboutsite]] in the same way as
authorNick Jenkins <nickj@users.mediawiki.org>
Fri, 16 Feb 2007 03:43:40 +0000 (03:43 +0000)
committerNick Jenkins <nickj@users.mediawiki.org>
Fri, 16 Feb 2007 03:43:40 +0000 (03:43 +0000)
[[MediaWiki:Disclaimers]]; Also means that if any of the footer links are
disabled in the wiki's default language (by setting to "-"), they'll also
be disabled in other languages too (e.g. if the user specifies uselang=fr),
which was probably want the site admin wanted to happen anyway.

RELEASE-NOTES
includes/Skin.php

index 95cabf6..d5a66f3 100644 (file)
@@ -187,6 +187,10 @@ lighter making things easier to read.
 * (bug 8944) The deprecated is_a() function is used in StubObjects.php
 * (bug 8978) Georgian i18n update
 * (bug 8992) Fix a remaining raw use of REQUEST_URI in history
+* (bug 3678) Allow disabling MediaWiki:aboutsite in the same way as
+  MediaWiki:Disclaimers; Also means that if any of the footer links are
+  disabled in the wiki's default language (by setting to "-"), they'll also
+  be disabled in other languages too (e.g. if the user specifies uselang=fr).
 
 
 == Languages updated ==
index b91c23f..55f1ca2 100644 (file)
@@ -1202,29 +1202,29 @@ END;
                return $s;
        }
 
-       function privacyLink() {
-               $privacy = wfMsg( 'privacy' );
-               if ($privacy == '-') {
+       private function footerLink ( $desc, $page ) {
+               // if the link description has been set to "-" in the default language,
+               if ( wfMsgForContent( $desc )  == '-') {
+                       // then it is disabled, for all languages.
                        return '';
                } else {
-                       return $this->makeKnownLink( wfMsgForContent( 'privacypage' ), $privacy);
+                       // Otherwise, we display the link for the user, described in their
+                       // language (which may or may not be the same as the default language),
+                       // but we make the link target be the one site-wide page.
+                       return $this->makeKnownLink( wfMsgForContent( $page ), wfMsg( $desc ) );
                }
        }
 
+       function privacyLink() {
+               return $this->footerLink( 'privacy', 'privacypage' );
+       }
+
        function aboutLink() {
-               $s = $this->makeKnownLink( wfMsgForContent( 'aboutpage' ),
-                 wfMsg( 'aboutsite' ) );
-               return $s;
+               return $this->footerLink( 'aboutsite', 'aboutpage' );
        }
 
        function disclaimerLink() {
-               $disclaimers = wfMsg( 'disclaimers' );
-               if ($disclaimers == '-') {
-                       return '';
-               } else {
-                       return $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ),
-                                                    $disclaimers );
-               }
+               return $this->footerLink( 'disclaimers', 'disclaimerpage' );
        }
 
        function editThisPage() {